package MyOs;
public class Pcb {
    private String name;
    public int pid;
    private Status status;
    private int remainTime;
    
   public Pcb(int pid) {
        this.pid = pid;
    }
   
   public void setPid(int pid){
       this.pid=pid;//人为改变进程的id
   }
   
    public int getPid() {
        return this.pid;
    }
   
    public void setRemainTime(int time) {
        this.remainTime = time;
    }

    public int getRemainTime() {
        return this.remainTime;
    }

    public void decreaseTime(long slice) {
        this.remainTime -= slice;
        if (this.remainTime < 0) {
            this.remainTime = 0;
        }
    }

    public String getName() {
        return this.name;
    }

    public void setName(String name) {
        this.name = name;
    }
   public Status getStatus(){
       return this.status;
   }
    public void setStatus(Status status){
        this.status=status;
    }
    public void setRunning() {
        this.status = Status.RUNNING;
    }

    public void setReady() {
        this.status = Status.READY;
    }

    public void setWaiting() {
        this.status = Status.WAITING;
    }

}
